package cn.net.pap.pinyincut.analysis;

import cn.net.pap.pinyincut.core.PinyinCutTokenizer;
import org.apache.lucene.analysis.Tokenizer;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractTokenizerFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;

public class PinyinCutTokenizerFactory extends AbstractTokenizerFactory {


    public PinyinCutTokenizerFactory(IndexSettings indexSettings, String name, Settings settings) {
        super(indexSettings, settings, name);
    }

    @Override
    public Tokenizer create() {
        return new PinyinCutTokenizer();
    }

    public static TokenizerFactory getTokenizerFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
        return new PinyinCutTokenizerFactory(indexSettings, name, settings);
    }
}
